function checkform (form) {
    var username = form.username.value;
    if (username == "") {
        alert ("Please enter a username");
        form.username.focus();
        return false;
    }
    if (username.length < 3 ){                    
        alert ("Username should be at least 3 characters long");
        form.username.focus();                    
        return false;
    }
    if (!((username.charAt(0) >= 'a' && username.charAt(0) <= 'z') || (username.charAt(0) >= 'A' && username.charAt(0) <= 'Z')) ) {
        alert ("Username has to start with a letter");
        form.username.focus();
        return false;
    }  
                
    var password = form.password.value;
                
    if (password == ""){
        alert ("Please enter a password");
        form.password.focus();                    
        return false;
    }
                
    if (password.length < 3){
        alert ("Password should be at least 3 characters long");
        form.password.focus();                    
        return false;
    }
                
    return true;                
}    